﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
using Coding4Fun.Phone.Controls;
using Wulong.Phone.Qiushi.i18n;

namespace Wulong.Phone.Qiushi.Helpers
{
    public static class MessageHelper
    {
        public static void ShowErrorMessage(Exception ex)
        {
            MessageBox.Show(AppResources.Ex_Network_Down_Message + "\r\n" + ex.Message,
                            AppResources.Ex_Error_Title,
                            MessageBoxButton.OK);
        }
        public static void ShowUpdateMessage(string title, string message, int updateCount)
        {
            var toast = new ToastPrompt
            {
                Title = title,
                Message = string.Format(message, updateCount),
                TextOrientation = Orientation.Vertical,
                ImageSource = new BitmapImage(new Uri("/images/message_received.png", UriKind.Relative))
            };
            toast.Show();
        }
    }            
}
